<script>
/* jQuery->validation */
$(document).ready(function(){
    $("#PacienteSolicitarForm").validate();
});    
</script>


<div id="titulo_encabezado" style="background: none; border: none;">
	<div style="float: left; padding: 6px; margin-top:10px; font-size: 16px; font-weight: normal;" class="btn btn-large btn-primary disabled">Solicitar Turno en <?php echo $sessCliente['Cliente']['name'];?></div>
    <div style="padding:6px; margin-top:10px;float:right; font-size: 14px; font-weight: normal;">
        <?php if($sessCliente['Medico']['id']>0){ echo "Dr: ".$sessCliente['Medico']['name']; } ?> 
    </div>    
</div>
    <div style="padding:6px; margin-top:10px;font-size: 14px; font-weight: normal; display:block; clear:both;">
		<b>Sucursal:</b> <?php echo $Sucursal['Sucursal']['name'];?>
		<br><?php echo $Sucursal['Sucursal']['direccion'];?>
		<br><?php echo $Sucursal['Sucursal']['localidad'];?> - <?php echo $Sucursal['Sucursal']['provincia'];?>
		<br><?php echo $Sucursal['Sucursal']['telefono'];?>
	</div>

    <?php echo $this->Form->create('Paciente', array(
													'url' => array(
																'controller' => 'turnos', 
																'action'     => 'paso2'
																),
													'inputDefaults' => array(
																'label' => false,
																'div'   => false
																)
													)); ?>
    <table width='100%'>
        <tr>
            <td style="text-align:right; vertical-align:middle;font-size:14px;padding-right:10px;width:200px;">Sexo:</td>
            <td>
                <?php echo $this->Form->input('cliente_id', array(
																'value' => $sessCliente['Cliente']['cliente_id'], 
																'type'  => 'hidden'
															)); ?>
                
				<?php echo $this->Form->input('cliente_nombre', array(
																	'value' => $sessCliente['Cliente']['name'], 
																	'type'  => 'hidden'
																)); ?>  

                <?php echo $this->Form->input('usuario_id', array(
																'value' => $sessCliente['Medico']['id'], 
																'type'  => 'hidden'
															)); ?>
															
                <?php echo $this->Form->input('usuario_nombre', array(
																	'value' => $sessCliente['Medico']['name'], 
																	'type'  => 'hidden'
																)); ?>
                                
                <?php echo $this->Form->select('sexo', $sessCliente['Sexo'] , null, array(
																						'escape' => false, 
																						'empty'  => false, 
																						'class'  => 'required'
																					)); ?>
            </td>
        </tr>
        <tr><td colspan="2">&nbsp;</td></tr>
        <tr>
            <td style="text-align:right; vertical-align:middle;font-size:14px;padding-right:10px;">Email:</td>
            <td>
                <?php echo $this->Form->input('email', array(
															'value' => '', 
															'type'  => 'text', 
															'style' => 'width:240px',
															'class' => 'required email'
															)); ?>
            </td>
        </tr>
        <tr>
            <td style="text-align:right; vertical-align:middle;font-size:14px;padding-right:10px;">Teléfono:</td>
            <td>
                <?php echo $this->Form->input('telefono', array(
                                                            'value' => '', 
                                                            'type'  => 'text', 
                                                            'style' => 'width:240px',
                                                            'class' => 'required'
                                                            )); ?>
            </td>
        </tr>

        <tr><td colspan="2">&nbsp;</td></tr>
        <tr>
            <td style="text-align:right; vertical-align:middle;font-size:14px;padding-right:10px;">Fecha de Nacimiento:</td>
            <td>
            <?php 
                for($i=1;$i<=31;$i++){$dia[$i]=$i;}
                echo $this->Form->select('dia', $dia, null, array(
																'escape' => false, 
																'empty'  => '---', 
																'class'  => 'required' 
																));
                echo " / ";
                for($i=1;$i<=12;$i++){$mes[$i]=$i;}
                echo $this->Form->select('mes', $mes, null, array(
																'escape' => false, 
																'empty'  => '---', 
																'class'  => 'required' 
																));  
                echo " / ";
                $desde = date("Y",time()) - 110;
                for($i=date("Y",time());$i>$desde;$i--){$ano[$i]=$i;}
                echo $this->Form->select('ano', $ano, null, array(
																'escape' => false, 
																'empty'  => '---', 
																'class'  => 'required'
																));  
                  
            ?>
            </td>
        </tr>
        <tr><td colspan="2">&nbsp;</td></tr>
        <tr>
            <td>&nbsp;</td>
            <td >
				<input type='hidden' name='sucursal_id' value='<?php echo $Sucursal['Sucursal']['id'];?>' >
                <?php
                    $options = array(
									'label' => 'Enviar Datos',
                                    'class' => 'btn btn-success',
                                    'style' => 'width: 150px',
									'name'  => 'save'
									);
                    echo $this->Form->end($options); 
                ?>
            </td>
        </tr>
    
    </table>

</div>
<div class="clear"> </div>